package 包装类;

import java.util.Scanner;

public class NewScanner {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("nextLine:请输入");
        String s1 = sc.nextLine();//该输入方法，不会因为遇到空格就停止并录入停止程序，只会遇到回车键才会停止程序
        System.out.println(s1);

        System.out.println("-----------");
        System.out.println("next:请输入");
        String next = sc.next();//遇到空格就停止并录入停止程序
        System.out.println(next);

        System.out.println("-----------");
        System.out.println("nextInt:请输入");
        int i = sc.nextInt();//遇到空格就停止并录入停止程序
        System.out.println(i);
    }
}
